<?php
/**
 * Created by PhpStorm.
 * User: tengjs
 * Date: 2020/11/3
 * Time: 7:37
 */

namespace App\Http\Controllers\Api\Contact;

use App\Http\Controllers\Api\BaseController;
use Illuminate\Support\Facades\Validator;
use App\Admin\Models\ContentModel;

class ContactController extends BaseController
{
    /**
     * JoinUs
     *
     * @return array
     */
    public function joinUs()
    {
        $contentId = 4;
        $file = ['content_id', 'content_en as content'];
        $data_res = ContentModel::select($file)->where('content_id', '=', $contentId)->first();
        $data = [];
        if (!empty($data_res)) {
            $data = $data_res->toArray();
        }
        // 数据查询
        $result = [
            'code' => 0,
            'msg' => '数据获取成功！',
            'data' => $data
        ];

        return $this->success($result['data'], $result['msg'] ?: '数据获取成功！');
    }
}
